#!/usr/bin/env sh

# global settings
yabai -m config mouse_follows_focus             off
yabai -m config focus_follows_mouse             off
yabai -m config window_placement                second_child
yabai -m config window_topmost                  off
yabai -m config window_shadow                   float
yabai -m config window_opacity                  off
yabai -m config split_ratio                     0.50
yabai -m config auto_balance                    on
yabai -m config mouse_modifier                  fn
yabai -m config mouse_action1                   move
yabai -m config mouse_action2                   resize

# border
yabai -m config window_border                   on
yabai -m config window_border_width             5
yabai -m config active_window_border_color      0xff5b9dc9
yabai -m config normal_window_border_color      0xff555555
yabai -m config insert_feedback_color           0xffd75f5f

# general space settings
yabai -m config layout                          bsp
yabai -m config top_padding                     10
yabai -m config bottom_padding                  10
yabai -m config left_padding                    12
yabai -m config right_padding                   12
yabai -m config window_gap                      10

# Space labels
yabai -m space 1 --label "Primary"
yabai -m space 2 --label "Comms"
yabai -m space 3 --label "Tools"
yabai -m space 4 --label "Media"
yabai -m space 5 --label "Social"
yabai -m space 6 --label "Float"
yabai -m space 7 --label "Secondary"

# Space config
yabai -m config --space 6 layout float

# Unmanaged
yabai -m rule --add app="^System Preferences$"  manage=off border=off
yabai -m rule --add app="^QQ$"                  manage=off
yabai -m rule --add app="^WeChat$"              manage=off
yabai -m rule --add app="^licecap$"             manage=off
yabai -m rule --add app="^Finder$" sticky=on layer=above manage=off


# Primary
yabai -m rule --add app="kitty"                 space=1
yabai -m rule --add app="iterm2"                space=1
yabai -m rule --add app="Emacs"                 space=1

# Tools
yabai -m rule --add app="Microsoft Word"        space=3
yabai -m rule --add app="Postman"               space=3
yabai -m rule --add app="Activity Monitor"      space=3
yabai -m rule --add app="App Store"             space=3

# Media
yabai -m rule --add app="Music"                 space=4
yabai -m rule --add app="QuickTime Player"      space=4
yabai -m rule --add app="Spotify"               space=4

# Floating
yabai -m rule --add app="^System Preferences$"  space=6
yabai -m rule --add app="^QQ$"                  space=6
yabai -m rule --add app="^WeChat$"              space=6
